/*
 * StatusPanel.java
 *
 * Created on September 15, 2008, 12:55 PM
 */
package gui;

import application.IAppContext;
import gui.drawing.IStyleConstants.StyleList;
import java.util.ArrayList;

/**
 *
 * @author  kamlesh paunikar
 */
public class StatusPanel extends javax.swing.JPanel {

    private ArrayList<IStatusPanelListener> statusPanelListenerList = new ArrayList<IStatusPanelListener>();

    /** Creates new form StatusPanel */
    public StatusPanel(IAppContext appContext) {
        initComponents();
    }

    public void addStatusPanelListener(IStatusPanelListener statusPanelListener) {
        statusPanelListenerList.add(statusPanelListener);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        drawButton = new javax.swing.JButton();
        seqenceDiagramStyleCombo = new javax.swing.JComboBox();

        drawButton.setText("Draw");
        drawButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                drawButtonActionPerformed(evt);
            }
        });
        add(drawButton);

        seqenceDiagramStyleCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "PlainUML", "Rose", "qsd", "mscgen", "Omegapple", "BlueModern", "GreenEarth", "RoundGreen" }));
        seqenceDiagramStyleCombo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                seqenceDiagramStyleComboActionPerformed(evt);
            }
        });
        add(seqenceDiagramStyleCombo);
    }// </editor-fold>//GEN-END:initComponents

private void drawButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_drawButtonActionPerformed
    for (IStatusPanelListener statusPanelListener : statusPanelListenerList) {
        statusPanelListener.drawButtonActionPerformed(evt);
    }
}//GEN-LAST:event_drawButtonActionPerformed

private void seqenceDiagramStyleComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_seqenceDiagramStyleComboActionPerformed
// TODO add your handling code here:
    // String selectedItem=(String)seqenceDiagramStyleCombo.getSelectedItem();
}//GEN-LAST:event_seqenceDiagramStyleComboActionPerformed
    public StyleList getSelectedStyle() {
        String selectedItem = (String) seqenceDiagramStyleCombo.getSelectedItem();
        StyleList selectedStyle = StyleList.valueOf(selectedItem);
        return selectedStyle;
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton drawButton;
    private javax.swing.JComboBox seqenceDiagramStyleCombo;
    // End of variables declaration//GEN-END:variables
}
